From 4051ddb1125ad0df60de9811e76aff09f839192f Mon Sep 17 00:00:00 2001 From: "adsharma@linux-t08.sc.intel.com" Date: Mon, 23 May 2005 05:33:43 +0000 Subject: [PATCH] bitkeeper revision 1.1472.2.6 (42916b37WTfslw9tSflk_BS_9JVW1Q) vmx_vcpu.h, vmx_phy_mode.c, mkbuildtree, domain.c, Makefile: Fix VT-i build Signed-off-by: Kevin Tian Signed-off-by: Arun Sharma --- xen/arch/ia64/Makefile | 18 +++++++++++++++--- xen/arch/ia64/domain.c | 20 ++++++++++---------- xen/arch/ia64/tools/mkbuildtree | 10 +++++----- xen/arch/ia64/vmx_phy_mode.c | 4 ++-- xen/include/asm-ia64/vmx_vcpu.h | 4 ++-- 5 files changed, 34 insertions(+), 22 deletions(-) diff --git a/xen/arch/ia64/Makefile b/xen/arch/ia64/Makefile index 6c0e371fc4..fdb9fbe1b9 100644 --- a/xen/arch/ia64/Makefile +++ b/xen/arch/ia64/Makefile @@ -30,9 +30,22 @@ default: $(OBJS) head.o ia64lib.o xen.lds.s -Map map.out head.o $(ALL_OBJS) -o $(TARGET)-syms $(OBJCOPY) -R .note -R .comment -S $(TARGET)-syms $(TARGET) -asm-offsets.s: asm-offsets.c +asm-offsets.s: asm-offsets.c $(BASEDIR)/include/asm-ia64/.offsets.h.stamp $(CC) $(CFLAGS) -S -o $@ $< +$(BASEDIR)/include/asm-ia64/.offsets.h.stamp: +# Need such symbol link to make linux headers available + [ -e $(BASEDIR)/include/linux ] \ + || ln -s $(BASEDIR)/include/xen $(BASEDIR)/include/linux + [ -e $(BASEDIR)/include/asm-ia64/xen ] \ + || ln -s $(BASEDIR)/include/asm-ia64/linux $(BASEDIR)/include/asm-ia64/xen +# Solve circular reference on asm-offsets.h + [ -f $(BASEDIR)/include/asm-ia64/asm-offsets.h ] \ + || echo "#define IA64_TASK_SIZE 0" > $(BASEDIR)/include/asm-ia64/asm-offsets.h +#Bad hack. Force asm-offsets.h out-of-date + sleep 1 + touch $@ + # I'm sure a Makefile wizard would know a better way to do this xen.lds.s: xen.lds.S $(CC) -E $(CPPFLAGS) -P -DXEN -D__ASSEMBLY__ \ @@ -42,9 +55,8 @@ ia64lib.o: $(MAKE) -C lib && cp lib/ia64lib.o . clean: - rm -f *.o *~ core xen.lds.s $(BASEDIR)/include/asm-ia64/.offsets.h.stamp + rm -f *.o *~ core xen.lds.s $(BASEDIR)/include/asm-ia64/.offsets.h.stamp asm-offsets.s rm -f lib/*.o - $(MAKE) -C lib clean # setup.o contains bits of compile.h so it must be blown away delete-unfresh-files: diff --git a/xen/arch/ia64/domain.c b/xen/arch/ia64/domain.c index deee1321f9..8f12179c5d 100644 --- a/xen/arch/ia64/domain.c +++ b/xen/arch/ia64/domain.c @@ -40,6 +40,7 @@ #ifdef CONFIG_VTI #include #include +#include #endif // CONFIG_VTI #define CONFIG_DOMAIN0_CONTIGUOUS @@ -792,13 +793,15 @@ int construct_dom0(struct domain *d, unsigned long pkern_start; unsigned long pkern_entry; unsigned long pkern_end; + unsigned long ret; + unsigned long progress = 0; //printf("construct_dom0: starting\n"); /* Sanity! */ #ifndef CLONE_DOMAIN0 if ( d != dom0 ) BUG(); - if ( test_bit(DF_CONSTRUCTED, &d->flags) ) + if ( test_bit(_DOMF_constructed, &d->domain_flags) ) BUG(); #endif @@ -888,14 +891,11 @@ int construct_dom0(struct domain *d, /* Copy the initial ramdisk. */ /* Sync d/i cache conservatively */ - { - unsigned long ret; - unsigned long progress; - ret = ia64_pal_cache_flush(4, 0, &progress, NULL); - if (ret != PAL_STATUS_SUCCESS) - panic("PAL CACHE FLUSH failed for dom0.\n"); - printk("Sync i/d cache for dom0 image SUCC\n"); - } + ret = ia64_pal_cache_flush(4, 0, &progress, NULL); + if (ret != PAL_STATUS_SUCCESS) + panic("PAL CACHE FLUSH failed for dom0.\n"); + printk("Sync i/d cache for dom0 image SUCC\n"); + /* Physical mode emulation initialization, including * emulation ID allcation and related memory request */ @@ -919,8 +919,8 @@ int construct_dom0(struct domain *d, /* vpd is ready now */ vlsapic_reset(ed); vtm_init(ed); - set_bit(DF_CONSTRUCTED, &d->flags); + set_bit(_DOMF_constructed, &d->domain_flags); new_thread(ed, pkern_entry, 0, 0); // FIXME: Hack for keyboard input diff --git a/xen/arch/ia64/tools/mkbuildtree b/xen/arch/ia64/tools/mkbuildtree index 34ff02fa94..f9b58527dd 100644 --- a/xen/arch/ia64/tools/mkbuildtree +++ b/xen/arch/ia64/tools/mkbuildtree @@ -46,13 +46,13 @@ mkdir include/asm-generic mkdir include/asm-ia64/linux mkdir include/asm-ia64/linux/byteorder # use "gcc -Iinclude/asm-ia64" to find these linux includes -ln -s $XEN/include/xen $XEN/include/linux -ln -s $XEN/include/asm-ia64/linux $XEN/include/asm-ia64/xen +#ln -s $XEN/include/xen $XEN/include/linux +#ln -s $XEN/include/asm-ia64/linux $XEN/include/asm-ia64/xen # prepare for building asm-offsets (circular dependency) -echo '#define IA64_TASK_SIZE 0' > include/asm-ia64/asm-offsets.h -sleep 2 -touch arch/ia64/asm-offsets.c +#echo '#define IA64_TASK_SIZE 0' > include/asm-ia64/asm-offsets.h +#sleep 2 +#touch arch/ia64/asm-offsets.c # patches to xen/common files #xen_patch common/domain.c domain.c diff --git a/xen/arch/ia64/vmx_phy_mode.c b/xen/arch/ia64/vmx_phy_mode.c index 938cfeb051..def87baf9e 100644 --- a/xen/arch/ia64/vmx_phy_mode.c +++ b/xen/arch/ia64/vmx_phy_mode.c @@ -104,7 +104,7 @@ physical_mode_init(VCPU *vcpu) UINT64 psr; struct domain * d = vcpu->domain; - vcpu->domain->arch.emul_phy_rr0.rid = XEN_RR7_RID+((d->id)<<3); + vcpu->domain->arch.emul_phy_rr0.rid = XEN_RR7_RID+((d->domain_id)<<3); /* FIXME */ #if 0 vcpu->domain->arch.emul_phy_rr0.ps = 28; /* set page size to 256M */ @@ -112,7 +112,7 @@ physical_mode_init(VCPU *vcpu) vcpu->domain->arch.emul_phy_rr0.ps = EMUL_PHY_PAGE_SHIFT; /* set page size to 4k */ vcpu->domain->arch.emul_phy_rr0.ve = 1; /* enable VHPT walker on this region */ - vcpu->domain->arch.emul_phy_rr4.rid = XEN_RR7_RID + ((d->id)<<3) + 4; + vcpu->domain->arch.emul_phy_rr4.rid = XEN_RR7_RID + ((d->domain_id)<<3) + 4; vcpu->domain->arch.emul_phy_rr4.ps = EMUL_PHY_PAGE_SHIFT; /* set page size to 4k */ vcpu->domain->arch.emul_phy_rr4.ve = 1; /* enable VHPT walker on this region */ diff --git a/xen/include/asm-ia64/vmx_vcpu.h b/xen/include/asm-ia64/vmx_vcpu.h index 59966d1c7c..dc4e0977b7 100644 --- a/xen/include/asm-ia64/vmx_vcpu.h +++ b/xen/include/asm-ia64/vmx_vcpu.h @@ -54,7 +54,7 @@ #define VMM_RR_SHIFT 20 #define VMM_RR_MASK ((1UL<domain->id) << VMM_RR_SHIFT) + ((vcpu->domain->domain_id) << VMM_RR_SHIFT) extern u64 indirect_reg_igfld_MASK ( int type, int index, u64 value); extern u64 cr_igfld_mask (int index, u64 value); extern int check_indirect_reg_rsv_fields ( int type, int index, u64 value ); @@ -590,7 +590,7 @@ vmx_vrrtomrr(VCPU *vcpu,unsigned long val) ia64_rr rr; u64 rid; rr.rrval=val; - rid=(((u64)vcpu->domain->id)<domain->domain_id)<